home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / rzsz1004.zip / ZMODEM.H < prev    next >
C/C++ Source or Header  |  1991-09-14  |  6KB  |  138 lines

  1. /*
  2.  *   Z M O D E M . H     Manifest constants for ZMODEM
  3.  *    application to application file transfer protocol
  4.  *    Copyright 1991 Omen Technology Inc All Rights Reserved
  5.  *    04-17-89  Chuck Forsberg Omen Technology Inc
  6.  */
  7. #define ZPAD '*'    /* 052 Padding character begins frames */
  8. #define ZDLE 030    /* Ctrl-X Zmodem escape - `ala BISYNC DLE */
  9. #define ZDLEE (ZDLE^0100)    /* Escaped ZDLE as transmitted */
  10. #define ZBIN 'A'    /* Binary frame indicator (CRC-16) */
  11. #define ZHEX 'B'    /* HEX frame indicator */
  12. #define ZBIN32 'C'    /* Binary frame with 32 bit FCS */
  13. #define ZBINR32 'D'    /* RLE packed Binary frame with 32 bit FCS */
  14. #define ZVBIN 'a'    /* Binary frame indicator (CRC-16) */
  15. #define ZVHEX 'b'    /* HEX frame indicator */
  16. #define ZVBIN32 'c'    /* Binary frame with 32 bit FCS */
  17. #define ZVBINR32 'd'    /* RLE packed Binary frame with 32 bit FCS */
  18. #define ZRESC    0176    /* RLE flag/escape character */
  19. #define ZMAXHLEN 16    /* Max header information length  NEVER CHANGE */
  20. #define ZMAXSPLEN 1024    /* Max subpacket length  NEVER CHANGE */
  21.  
  22. /* Frame types (see array "frametypes" in zm.c) */
  23. #define ZRQINIT    0    /* Request receive init */
  24. #define ZRINIT    1    /* Receive init */
  25. #define ZSINIT 2    /* Send init sequence (optional) */
  26. #define ZACK 3        /* ACK to above */
  27. #define ZFILE 4        /* File name from sender */
  28. #define ZSKIP 5        /* To sender: skip this file */
  29. #define ZNAK 6        /* Last packet was garbled */
  30. #define ZABORT 7    /* Abort batch transfers */
  31. #define ZFIN 8        /* Finish session */
  32. #define ZRPOS 9        /* Resume data trans at this position */
  33. #define ZDATA 10    /* Data packet(s) follow */
  34. #define ZEOF 11        /* End of file */
  35. #define ZFERR 12    /* Fatal Read or Write error Detected */
  36. #define ZCRC 13        /* Request for file CRC and response */
  37. #define ZCHALLENGE 14    /* Receiver's Challenge */
  38. #define ZCOMPL 15    /* Request is complete */
  39. #define ZCAN 16        /* Other end canned session with CAN*5 */
  40. #define ZFREECNT 17    /* Request for free bytes on filesystem */
  41. #define ZCOMMAND 18    /* Command from sending program */
  42. #define ZSTDERR 19    /* Output to standard error, data follows */
  43.  
  44. /* ZDLE sequences */
  45. #define ZCRCE 'h'    /* CRC next, frame ends, header packet follows */
  46. #define ZCRCG 'i'    /* CRC next, frame continues nonstop */
  47. #define ZCRCQ 'j'    /* CRC next, frame continues, ZACK expected */
  48. #define ZCRCW 'k'    /* CRC next, ZACK expected, end of frame */
  49. #define ZRUB0 'l'    /* Translate to rubout 0177 */
  50. #define ZRUB1 'm'    /* Translate to rubout 0377 */
  51.  
  52. /* zdlread return values (internal) */
  53. /* -1 is general error, -2 is timeout */
  54. #define GOTOR 0400
  55. #define GOTCRCE (ZCRCE|GOTOR)    /* ZDLE-ZCRCE received */
  56. #define GOTCRCG (ZCRCG|GOTOR)    /* ZDLE-ZCRCG received */
  57. #define GOTCRCQ (ZCRCQ|GOTOR)    /* ZDLE-ZCRCQ received */
  58. #define GOTCRCW (ZCRCW|GOTOR)    /* ZDLE-ZCRCW received */
  59. #define GOTCAN    (GOTOR|030)    /* CAN*5 seen */
  60.  
  61. /* Byte positions within header array */
  62. #define ZF0    3    /* First flags byte */
  63. #define ZF1    2
  64. #define ZF2    1
  65. #define ZF3    0
  66. #define ZP0    0    /* Low order 8 bits of position */
  67. #define ZP1    1
  68. #define ZP2    2
  69. #define ZP3    3    /* High order 8 bits of file position */
  70.  
  71. /* Bit Masks for ZRINIT flags byte ZF0 */
  72. #define CANFDX    01    /* Rx can send and receive true FDX */
  73. #define CANOVIO    02    /* Rx can receive data during disk I/O */
  74. #define CANBRK    04    /* Rx can send a break signal */
  75. #define CANRLE    010    /* Receiver can decode RLE */
  76. #define CANLZW    020    /* Receiver can uncompress */
  77. #define CANFC32    040    /* Receiver can use 32 bit Frame Check */
  78. #define ESCCTL 0100    /* Receiver expects ctl chars to be escaped */
  79. #define ESC8   0200    /* Receiver expects 8th bit to be escaped */
  80.  
  81. /* Bit Masks for ZRINIT flags byte ZF1 */
  82. #define CANVHDR    01    /* Variable headers OK */
  83.  
  84. /* Parameters for ZSINIT frame */
  85. #define ZATTNLEN 32    /* Max length of attention string */
  86. #define ALTCOFF ZF1    /* Offset to alternate canit string, 0 if not used */
  87. /* Bit Masks for ZSINIT flags byte ZF0 */
  88. #define TESCCTL 0100    /* Transmitter expects ctl chars to be escaped */
  89. #define TESC8   0200    /* Transmitter expects 8th bit to be escaped */
  90.  
  91. /* Parameters for ZFILE frame */
  92. /* Conversion options one of these in ZF0 */
  93. #define ZCBIN    1    /* Binary transfer - inhibit conversion */
  94. #define ZCNL    2    /* Convert NL to local end of line convention */
  95. #define ZCRESUM    3    /* Resume interrupted file transfer */
  96. /* Management include options, one of these ored in ZF1 */
  97. #define ZMSKNOLOC    0200    /* Skip file if not present at rx */
  98. /* Management options, one of these ored in ZF1 */
  99. #define ZMMASK    037    /* Mask for the choices below */
  100. #define ZMNEWL    1    /* Transfer if source newer or longer */
  101. #define ZMCRC    2    /* Transfer if different file CRC or length */
  102. #define ZMAPND    3    /* Append contents to existing file (if any) */
  103. #define ZMCLOB    4    /* Replace existing file */
  104. #define ZMNEW    5    /* Transfer if source newer */
  105.     /* Number 5 is alive ... */
  106. #define ZMDIFF    6    /* Transfer if dates or lengths different */
  107. #define ZMPROT    7    /* Protect destination file */
  108. #define ZMCHNG    8    /* Change filename if destination exists */
  109. /* Transport options, one of these in ZF2 */
  110. #define ZTLZW    1    /* Lempel-Ziv compression */
  111. #define ZTRLE    3    /* Run Length encoding */
  112. /* Extended options for ZF3, bit encoded */
  113. #define ZXSPARS    64    /* Encoding for sparse file operations */
  114. #define ZCANVHDR    01    /* Variable headers OK */
  115. /* Receiver window size override */
  116. #define ZRWOVR 4    /* byte position for receive window override/256 */
  117.  
  118. /* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
  119. #define ZCACK1    1    /* Acknowledge, then do command */
  120.  
  121. long rclhdr();
  122.  
  123. /* Globals used by ZMODEM functions */
  124. extern Rxframeind;    /* ZBIN ZBIN32, or ZHEX type of frame */
  125. extern Rxtype;        /* Type of header received */
  126. extern Rxcount;        /* Count of data bytes received */
  127. extern Rxtimeout;    /* Tenths of seconds to wait for something */
  128. extern long Rxpos;    /* Received file position */
  129. extern long Txpos;    /* Transmitted file position */
  130. extern Txfcs32;        /* TURE means send binary frames with 32 bit FCS */
  131. extern Crc32t;        /* Display flag indicating 32 bit CRC being sent */
  132. extern Crc32;        /* Display flag indicating 32 bit CRC being received */
  133. extern Znulls;        /* Number of nulls to send at beginning of ZDATA hdr */
  134. extern char Attn[ZATTNLEN+1];    /* Attention string rx sends to tx on err */
  135. extern char *Altcan;    /* Alternate canit string */
  136.  
  137. /* End of ZMODEM.H */
  138.